package ch.bfh.abhmcm.SoftwareEngineeringAndDesign.controller;

import java.sql.ResultSet;
import java.sql.SQLException;

import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.model.Workorder;

public class WorkOrderMaker {
	
	public Workorder makeanewWorkrder(ResultSet rs) throws SQLException{
		
		Workorder workorder = new Workorder();
		
		workorder.setWo_id(rs.getString(Workorder.TC_WO_ID));
		workorder.setRfc_id(rs.getString(Workorder.TC_RFC_ID));
		workorder.setWo_title(rs.getString(Workorder.TC_WO_TITLE));
		workorder.setWo_typ(rs.getString(Workorder.TC_WO_TYP));
		workorder.setResponsible(rs.getString(Workorder.TC_RESPONIBLE));
		workorder.setDescription(rs.getString(Workorder.TC_DESCRIPTION));
		workorder.setAffected_services(rs.getString(Workorder.TC_AFFECTED_SERVICES));
		workorder.setAffected_infrastructures(rs.getString(Workorder.TC_AFFECTED_INFRASTRUCTURES));
		workorder.setPlanned_start(rs.getString(Workorder.TC_PLANNED_START));
		workorder.setActual_start(rs.getString(Workorder.TC_ACTUAL_START));
		workorder.setPlanned_end(rs.getString(Workorder.TC_PLANNED_END));
		workorder.setActual_end(rs.getString(Workorder.TC_ACTUAL_END));
		workorder.setPlanned_effort(rs.getString(Workorder.TC_PLANNED_EFFORD));
		workorder.setNotes(rs.getString(Workorder.TC_NOTES));
		workorder.setWo_status(rs.getString(Workorder.TC_WO_STATUS));
		
		return workorder;
		
	}

}
